package com.zhsq.zlc.controller.combobox;

import com.zhsq.zlc.entity.*;
import com.zhsq.zlc.service.combobox.ComboboxService;
import com.zhsq.zlc.service.log.LogService;
import com.zhsq.zlc.service.user.UserService;
import com.zhsq.zlc.util.Constant;
import com.zhsq.zlc.util.MD5Util;
import com.zhsq.zlc.util.PageUtil;
import com.zhsq.zlc.util.SessionInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class ComboboxController {

	@Autowired
	private ComboboxService comboboxService;

	/**
	 * 查找区域列表
	 * @param params
	 * @param request
	 * @return
	 */
	@ResponseBody
	@PostMapping("/zhsq/listRegionsCombobox")
	public ResultObject<Object> listRegionsCombobox(@RequestParam Map<String,Object> params, HttpServletRequest request) throws Exception{
		List<ComboboxEntity> list=comboboxService.listRegionsCombobox(params);
		ResultObject<Object> object = new ResultObject<Object>(Constant.Code01, Constant.Msg01, list, null);
		return object;
	}

	/**
	 * 查找定位基站列表
	 * @param params
	 * @param request
	 * @return
	 */
	@ResponseBody
	@PostMapping("/zhsq/listDwjzsCombobox")
	public ResultObject<Object> listDwjzsCombobox(@RequestParam Map<String,Object> params, HttpServletRequest request) throws Exception{
		List<ComboboxEntity> list=comboboxService.listDwjzsCombobox(params);
		ResultObject<Object> object = new ResultObject<Object>(Constant.Code01, Constant.Msg01, list, null);
		return object;
	}

	/**
	 * 查找激活器列表
	 * @param params
	 * @param request
	 * @return
	 */
	@ResponseBody
	@PostMapping("/zhsq/listJihuoqisCombobox")
	public ResultObject<Object> listJihuoqisCombobox(@RequestParam Map<String,Object> params, HttpServletRequest request) throws Exception{
		List<ComboboxEntity> list=comboboxService.listJihuoqisCombobox(params);
		ResultObject<Object> object = new ResultObject<Object>(Constant.Code01, Constant.Msg01, list, null);
		return object;
	}
}
